/* 基础样式重置和字体设置 */
.falcon5-language-switcher,
.falcon5-language-switcher * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.falcon5-language-switcher {
    position: relative;
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    z-index: 99999999;
    min-width: 250px;
    line-height: normal;
    text-align: left;
    height: auto;
    transition: height 0.3s ease;
    overflow: hidden;
}

/* 当前语言按钮样式增强 */
.falcon5-language-switcher .current-language {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    cursor: pointer;
    background: white;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 14px;
    font-weight: normal;
    letter-spacing: normal;
}

/* 语言项样式增强 */
.falcon5-language-switcher .language-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
    font-size: 14px;
    font-weight: normal;
    letter-spacing: normal;
    line-height: 1.4;
}

/* 文本样式重置 */
.falcon5-language-switcher .current-language span,
.falcon5-language-switcher .language-item span {
    font-family: inherit;
    text-transform: none;
    text-decoration: none;
    text-align: left;
    vertical-align: middle;
    line-height: 1.4;
}

/* 图片样式重置 */
.falcon5-language-switcher img {
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
    margin: 0 8px 0 0;
    padding: 0;
    border: none;
    max-width: none;
    box-shadow: none;
}

/* 下拉列表样式增强 */
.falcon5-language-switcher .language-list {
    position: relative;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    display: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-height: 0;
    overflow-y: auto;
    min-width: 100%;
    z-index: 99999999;
    transition: max-height 0.3s ease;
}

/* 箭头样式增强 */
.falcon5-language-switcher .current-language .falcon5-arrow {
    margin-left: auto;
    border: solid #666;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    min-width: 0;
    min-height: 0;
}

/* 底部左侧 */
.falcon5-language-switcher.position-bottom-left {
    position: fixed;
    bottom: 20px;
    left: 20px;
}

/* 底部右侧 */
.falcon5-language-switcher.position-bottom-right {
    position: fixed;
    bottom: 20px;
    right: 20px;
}

/* 顶部左侧 */
.falcon5-language-switcher.position-top-left {
    position: fixed;
    top: 20px;
    left: 20px;
}

/* 顶部右侧 */
.falcon5-language-switcher.position-top-right {
    position: fixed;
    top: 20px;
    right: 20px;
}

/* 调整下拉列表的基础样式 */
.language-list {
    position: absolute;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    display: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
    min-width: 100%;
    z-index: 99999999;
}

/* 向下展开（Bottom方向） */
.direction-bottom .language-list {
    bottom: auto;
    margin-top: 4px;
}

/* 向上展开（Top方向） */
.direction-top .language-list {
    bottom: 100%;
    top: auto;
    margin-bottom: 4px;
}

.falcon5-language-switcher .current-language.active .falcon5-arrow {
    transform: rotate(-135deg);
}

.falcon5-language-switcher .current-language .falcon5-arrow {
    transform: rotate(45deg);
}

/* 保持水平对齐方式 */
.position-bottom-left .language-list,
.position-top-left .language-list {
    left: 0;
    right: auto;
}

.position-bottom-right .language-list,
.position-top-right .language-list {
    right: 0;
    left: auto;
}

/* 移除之前的动态方向相关样式 */
.language-list.dropdown-up,
.language-list.dropdown-down {
    top: auto;
    bottom: auto;
    margin: 0;
}

/* 确保 show 类正确显示 */
.language-list.show {
    display: block !important;
}

.current-language {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    cursor: pointer;
    background: white;
    transition: all 0.3s ease;
}

.current-language:hover {
    border-color: #ccc;
    background-color: #f8f8f8;
}

.current-language img {
    width: 16px;
    height: 16px;
    border-radius: 2px;
}

.current-language .falcon5-arrow {
    margin-left: auto;
    border: solid #666;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}

.language-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.language-item:hover {
    background-color: #f0f7ff;
}

.language-item.selected {
    background-color: #e6f2ff;
}

.language-item.selected:hover {
    background-color: #d9ecff;
}

.language-item img {
    width: 16px;
    height: 16px;
    border-radius: 2px;
}

/* 滚动条样式 */
.language-list::-webkit-scrollbar {
    width: 6px;
}

.language-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.language-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.language-list::-webkit-scrollbar-thumb:hover {
    background: #999;
}


/* 添加 .show 类的样式 */
.language-list.show {
    display: block !important;
}

/* 国旗大小设置 */
.falcon5-language-switcher.flag-size-16px img, .fc5-link.flag-size-16px img {
    height: 16px;
    width: auto;
}

.falcon5-language-switcher.flag-size-24px img, .fc5-link.flag-size-24px img {
    height: 24px;
    width: auto;
}

.falcon5-language-switcher.flag-size-32px img, .flag-size-32px img {
    height: 32px;
    width: auto;
}

/* 国旗样式设置 */
.falcon5-language-switcher.flag-style-2d img, .fc5-link.flag-style-2d img {
    border-radius: 2px;
}

.falcon5-language-switcher.flag-style-3d img, .fc5-link.flag-style-3d img {
    border-radius: 2px;
    filter: drop-shadow(rgb(153, 153, 153) 0px 0px 4px);
}

/* 确保图片在容器中居中显示 */
.falcon5-language-switcher .current-language img,
.falcon5-language-switcher .language-item img {
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
    margin-right: 8px;
}

/* 调整不同尺寸下的间距 */
.falcon5-language-switcher.flag-size-16px .current-language,
.falcon5-language-switcher.flag-size-16px .language-item {
    padding: 8px 12px;
}

.falcon5-language-switcher.flag-size-24px .current-language,
.falcon5-language-switcher.flag-size-24px .language-item {
    padding: 10px 14px;
}

.falcon5-language-switcher.flag-size-32px .current-language,
.falcon5-language-switcher.flag-size-32px .language-item {
    padding: 12px 16px;
}

/* 确保文字垂直居中 */
.falcon5-language-switcher .current-language span,
.falcon5-language-switcher .language-item span {
    vertical-align: middle;
    line-height: 1;
}

/* fc5-link 基础样式重置 */
.fc5-link,
.fc5-link * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* fc5-link 主体样式 */
.fc5-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    font-weight: normal;
    line-height: 1.4;
    letter-spacing: normal;
    color: inherit;
    text-align: left;
    border: none;
    background: none;
    padding: 4px 8px;
    margin: 0;
    cursor: pointer;
}

/* fc5-link 图片样式 */
.fc5-link img {
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
    margin: 0 8px 0 0;
    padding: 0;
    border: none;
    max-width: none;
    box-shadow: none;
}

/* fc5-link 文本样式 */
.fc5-link span {
    font-family: inherit;
    text-transform: none;
    text-decoration: none;
    text-align: left;
    vertical-align: middle;
    line-height: 1.4;
}

/* fc5-link hover状态 */
.fc5-link:hover {
    text-decoration: none;
    opacity: 0.9;
}

/* fc5-link focus状态 */
.fc5-link:focus {
    outline: none;
    text-decoration: none;
}

/* fc5-link active状态 */
.fc5-link:active {
    text-decoration: none;
}

/* 国旗大小设置 - 确保与switcher保持一致 */
.fc5-link.flag-size-16px img {
    height: 16px;
    width: auto;
}

.fc5-link.flag-size-24px img {
    height: 24px;
    width: auto;
}

.fc5-link.flag-size-32px img {
    height: 32px;
    width: auto;
}

/* 国旗样式设置 - 确保与switcher保持一致 */
.fc5-link.flag-style-2d img {
    border-radius: 2px;
}

.fc5-link.flag-style-3d img {
    border-radius: 2px;
    filter: drop-shadow(rgb(153, 153, 153) 0px 0px 4px);
}

/* 确保链接在不同状态下保持样式 */
.fc5-link:link,
.fc5-link:visited {
    color: inherit;
    text-decoration: none;
}

/* 确保在WordPress编辑器中的样式 */
.wp-block .fc5-link,
.wp-block-paragraph .fc5-link,
.entry-content .fc5-link {
    display: inline-flex;
    text-decoration: none;
    border: none;
    background: none;
    box-shadow: none;
}

/* 确保在不同主题中的样式一致性 */
.theme-content .fc5-link,
.site-content .fc5-link,
.post-content .fc5-link,
.page-content .fc5-link {
    display: inline-flex;
    text-decoration: none;
    border: none;
    background: none;
    box-shadow: none;
}

/* 展开状态的样式 */
.falcon5-language-switcher.position-bottom-left.position-bottom-right.expanded {
    height: 200px;
}

/* 展开状态下拉列表的样式 */
.falcon5-language-switcher .language-list.show {
    display: block;
    max-height: 200px;
} 